import $http from '../../../servers/http';
import { Result } from 'seats/schema/Result';
import {
  BillDetailsRequest,
  BillDetailsResponse,
  CompanyBillResponse,
  DailyBillRequest,
  DailyBillResponse,
  ExportRequest,
  ExportResponse,
  MonthlyBillRequest,
  MonthlyBillResponse,
  RechargeRecordsRequest,
  RechargeRecordsResponse,
} from 'admin/schema/EnterpriseBill';

/**获取企业计费信息*/
export const getCompanyBill = (data: {
  companyId: string;
}): Promise<Result<CompanyBillResponse>> => {
  return $http.get({
    url: `/billingSystem/companyBillingManage/companyBill`,
    data,
  });
};

/**查询【月账单】列表 */
export const getCompanyMonthBill = (
  data: MonthlyBillRequest
): Promise<Result<MonthlyBillResponse>> => {
  return $http.get({
    url: `/billingSystem/companyBillingManage/monthlyBill`,
    data,
  });
};

/**创建【月账单】下载任务-导出 */
export const createCompanyMonthBillDownloadTask = (
  data: ExportRequest
): Promise<Result<ExportResponse>> => {
  return $http.post({
    url: '/billingSystem/companyBillingManage/monthlyBill/export',
    data,
  });
};

/**查询【日账单】列表 */
export const getCompanyDayBill = (data: DailyBillRequest): Promise<Result<DailyBillResponse>> => {
  return $http.get({
    url: `/billingSystem/companyBillingManage/dailyBill`,
    data,
  });
};

/**创建【日账单】下载任务-导出 */
export const createCompanyDayBillDownloadTask = (
  data: ExportRequest
): Promise<Result<ExportResponse>> => {
  return $http.post({
    url: '/billingSystem/companyBillingManage/dailyBill/export',
    data,
  });
};

/**查询【账单明细】列表 */
export const getCompanyBillDetail = (
  data: BillDetailsRequest
): Promise<Result<BillDetailsResponse>> => {
  return $http.get({
    url: `/billingSystem/companyBillingManage/billDetails`,
    data,
  });
};

/**创建【账单明细】下载任务-导出 */
export const createCompanyBillDetailDownloadTask = (
  data: ExportRequest
): Promise<Result<ExportResponse>> => {
  return $http.post({
    url: '/billingSystem/companyBillingManage/billDetails/export',
    data,
  });
};

/**查询【充值记录】列表 */
export const getCompanyRechargeRecord = (
  data: RechargeRecordsRequest
): Promise<Result<RechargeRecordsResponse>> => {
  return $http.get({
    url: `/billingSystem/companyBillingManage/rechargeRecords`,
    data,
  });
};
